


#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "wx/pdfdoc.h"



void
transparency() {
  wxPdfDocument pdf;
  pdf.AddPage();
  pdf.SetFont(wxT("Helvetica"),wxT(""),16);

  int j;
  wxString txt;
  for (j = 0; j < 180; j++) txt += wxT("Hello World! ");
  pdf.MultiCell(0,8, txt);

 

 
  int maskImg = pdf.ImageMask(wxT("mask.png"));

 
  pdf.Image(wxT("image.png"), 55, 10, 100, 0, wxT("png"), wxPdfLink(-1), maskImg);

 
 

 
  pdf.Image(wxT("image_with_alpha.png"), 55, 190, 100);

  pdf.AddPage();
  pdf.SetLineWidth(1.5);

 
  pdf.SetAlpha();
  pdf.SetFillColour(wxPdfColour(255,0,0));
  pdf.Rect(10, 10, 40, 40, wxPDF_STYLE_FILLDRAW);

 
  pdf.SetAlpha(1, 0.5);

 
  pdf.SetFillColour(wxPdfColour(0,255,0));
  pdf.Rect(20, 20, 40, 40, wxPDF_STYLE_FILLDRAW);

 
  pdf.Image(wxT("flower.jpg"), 30, 30, 40);

 
  pdf.SetAlpha();

 
  pdf.SetFont(wxT("Helvetica"), wxT(""), 12);
  pdf.Text(46,68,wxT("Flower"));

  pdf.SaveAsFile(wxT("transparency.pdf"));
}
